package controllers

import (
	"log"
	"net/http"
	"strings"
)

func Register(w http.ResponseWriter, r *http.Request) {
	urlPath := strings.ToLower(r.URL.Path)
	log.Println("url:", urlPath)
	switch {
	case strings.HasPrefix(urlPath, "/static"):
		http.ServeFile(w, r, urlPath[1:])
	case "/favicon.ico" == urlPath:
		http.ServeFile(w, r, "static/images/favicon.ico")
	case "/" == urlPath:
		Index(w, r)
	}
}
